FormCtl = Ext.extend(CmpControler, {

			bulidComponent : function() {

				var config = this.getCommonConfig();

				config = this.configItems(config);

				config = this.configButtons(config);

				config = this.configReader(config);

				var item = new Ext.FormPanel(config);

				return item;
			},
			getCommonConfig : function() {

				var config = {
					split : true,
					autoScroll : true,
					labelAlign : 'right',
					labelWidth : 60,
					frame : true
				};

				return config;

			},
			configButtons : function(config) {

				return config;

			},
			configReader : function(config) {
				return config;

			},
			configBbar : function(config) {

				// var barConfig = {};
				//
				// var items = ['-', {
				// // iconCls : 'badd',
				// text : '查询',
				// handler : this.auditPass,
				// scope : this
				// }, '-'];
				//
				// barConfig.items = items;
				//
				// var bar = new Ext.Toolbar(barConfig);
				//
				// config.bbar = bar;
				//
				return config;

			},
			getTextField : function(label, name, allowBlank, maxLength) {

				var config = {
					fieldLabel : label,
					name : name,
					//allowBlank : allowBlank,
					height : 20,
					width : cf.getC('gcc').sw * 0.15
				};

				if (allowBlank) {
					config.allowBlank = allowBlank;
				}

				if (maxLength) {
					config.maxLength = maxLength;
				}

				var item = new Ext.form.TextField(config);

				return item;

			},
			getTextArea : function(label, name, h, w) {

				var item = new Ext.form.TextArea({
							fieldLabel : label,
							name : name,
							height : h,
							width : w
						});

				return item;

			},
			getDateField : function(label, name, allowBlank) {

				var item = new Ext.form.DateField({
							fieldLabel : label,
							allowBlank : allowBlank,
							name : name,
					width : cf.getC('gcc').sw * 0.15,
							format : 'Y-m-d'
						});

				return item;

			},
			getCombobox : function(label, name, islocal, data, hiddenName) {

				var config = {
					name : name,
					fieldLabel : label,
					mode : 'local',
					triggerAction : 'all',
					width : cf.getC('gcc').sw * 0.15,
					editable : false
				};

				if (hiddenName) {
					config.hiddenName = name;
				}

				config = this.getCbbStore(config, islocal, data);

				var item = new Ext.form.ComboBox(config);
				item.cbbStore = config.store;

				return item;

			},
			getCbbStore : function(config, islocal, data) {

				var storeConfig = {
					root : "items",
					// totalProperty : "totalCount",
					// id : 'entryId',
					fields : ["key", "value"]
				}
				if (!islocal) {
					storeConfig.url = data;
				}

				var dataStore = new Ext.data.JsonStore(storeConfig);

				if (islocal) {
					dataStore.loadData(data);
				} else {
					dataStore.load();
				}

				config.valueField = 'key';
				config.displayField = 'value';

				config.store = dataStore; // [['f','Foo'],['b','Bar']];

				return config;

			},
			getHiddenField : function(name) {

				var item = new Ext.form.Hidden({
							name : name
						});

				return item;

			},
			submit : function() {
				var url = this.getSubmitUrl();

				var submitConfig = {
					url : url,
					method : 'POST',
					success : this.submitSuccess,
					scope : this,
					failure : function(form, action) {
						Ext.example.msg('保存失败', '添加级别失败！');
					},
					waitMsg : '正在保存数据，稍后...'
				};

				submitConfig = this.getParams(submitConfig);

				this.cmp.form.submit(submitConfig);
			},
			getParams : function(config) {

				return config;

			},
			load : function(params) {
				var url = this.getLoadUrl();
				var params = this.getLoadParams(params);
				this.cmp.form.load({
							url : url,
							waitMsg : '正在载入数据...',
							params : params,
							success : function(form, action) {
								// Ext.example.msg('编辑', '载入成功！');
							},
							failure : function(form, action) {
								// Ext.example.msg('编辑', '载入失败');
							}
						});

			},
			reset : function() {
				this.cmp.form.reset();
			}

		});
